﻿// Fighter Class
var Fighter = function() {
    // ** Private Variables **

    // Personal
    var firstName = "ERROR";
    var lastName = "ERROR";

    var specialty = 0;

	// Stats
    var health = 0;
    var power = 0;
    var mind = 0;
    var anima = 0;
    var defense = 0;
    var protection = 0;
    var preservation = 0;
    var speed = 0;

	// Battle Conditions
    var isStunned = false;

    var battleAction = 0;

	// AI
    var isAI = false;

	// ** Privileged Methods **

	// Gets
    this.getFirstName = function() { return firstName; },
	this.getLastName = function() { return lastName; },
	this.getFullName = function() { return firstName + " " + lastName; },

	this.getSpecialty = function() { return specialty; },

	this.getHealth = function() { return health; },
	this.getPower = function() { return power; },
	this.getMind = function() { return mind; },
	this.getAnima = function() { return anima; },
	this.getDefense = function() { return defense; },
	this.getProtection = function() { return protection; },
	this.getPreservation = function() { return preservation; },
	this.getSpeed = function() { return speed; },

	this.getIsStunned = function() { return isStunned; },

	this.getBattleAction = function() { return battleAction; },

	this.getIsAI = function () { return isAI; }

    // Sets
    this.setFirstName = function (value) { firstName = value; }
    this.setLastName = function (value) { lastName = value; }
    
    this.setSpecialty = function (value) { specialty = value; }

    this.addHealth = function (value) { health += value; }
    this.subHealth = function (value) { health -= value; }
    this.setHealth = function (value) { health = value; }
    this.addPower = function (value) { power += value; }
    this.subPower = function (value) { power -= value; }
    this.setPower = function (value) { power = value; }
    this.addMind = function (value) { mind += value; }
    this.subMind = function (value) { mind -= value; }
    this.setMind = function (value) { mind = value; }
    this.addAnima = function (value) { anima += value; }
    this.subAnima = function (value) { anima -= value; }
    this.setAnima = function (value) { anima = value; }
    this.addDefense = function (value) { defense += value; }
    this.subDefense = function (value) { defense -= value; }
    this.setDefense = function (value) { defense = value; }
    this.addProtection = function (value) { protection += value; }
    this.subProtection = function (value) { protection -= value; }
    this.setProtection = function (value) { protection = value; }
    this.addSpeed = function (value) { speed += value; }
    this.subSpeed = function (value) { speed -= value; }
    this.setSpeed = function (value) { speed = value; }

    this.setIsStunned = function (value) { isStunned = value; }

    this.setBattleAction = function (value) { battleAction = value; }

};

Fighter.prototype.getSpecialty = function () { return specialty; }
Fighter.prototype.setSpecialty = function (value) { specialty = value; }

// AI Class
var AI = function () {
    // Inherit Fighter
    this.fighter = new Fighter();

    // ** Private Variables **
    var difficulty;

    // ** Privileged Methods **
    this.getDifficulty = function () { return difficulty; }

    this.setDifficulty = function (value) { difficulty = value; }

}

// User Class
var User = function () {
    // Inherit Fighter
    this.fighter = new Fighter();

    // Stats
    var level = 1;
    var experience = 0;

    this.getLevel = function () { return level; },
    this.getExperience = function () { return experience; },

    this.addLevel = function (value) { level += value; }
    this.subLevel = function (value) { level -= value; }
    this.setLevel = function (value) { level = value; }
    this.addExperience = function (value) { experience += value; }
    this.subExperience = function (value) { experience -= value; }
    this.setExperience = function (value) { experience = value; }
}

// Test Class
var Blue = function () {
    var color = 1;

    this.getColor = function () { return color; }
    this.setColor = function (c) { color = c; }
}

var Sky = function () {
    var clouds = 2;

    this.getClouds = function () { return clouds; }
    this.setClouds = function (c) { clouds = c; }

    this.blue = new Blue();
}